/**
 * 
 */
package it.rainbowbreeze.polygen.domain;

/**
 * @author rainbowbreeze
 *
 */
public class ListItem {

    private final long mItemId;
    private final long mParentId;
    private final boolean mIsCategory;
    private final boolean mIsBackItem;
    private final String mName;
    private final String mUrl;


    /**
     * Used to build a category
     * 
     * @param itemId
     * @param parentId
     * @param categoryName
     */
    public ListItem(long itemId, long parentId, String categoryName) {
        mItemId = itemId;
        mParentId = parentId;
        mIsCategory = true;
        mName = categoryName;
        mUrl = null;
        mIsBackItem = false;
    }

    /**
     * Used to build an item
     * 
     * @param itemId
     * @param parentId
     * @param sectionName
     * @param sectionUrl
     */
    public ListItem(long itemId, long parentId, String sectionName, String sectionUrl) {
        mItemId = itemId;
        mParentId = parentId;
        mIsCategory = false;
        mName = sectionName;
        mUrl = sectionUrl;
        mIsBackItem = false;
    }
    
    /**
     * Used to build a back item
     * 
     * @param parentId
     * @param backText
     */
    public ListItem(long parentId, String backText) {
        mItemId = -1; //TODO
        mParentId = parentId;
        mIsCategory = false;
        mName = backText;
        mUrl = null;
        mIsBackItem = true;
    }
    

    public long getId() {
        return mItemId;
    }

    public long getParentId() {
        return mParentId;
    }
    
    public boolean isCategory() {
        return mIsCategory;
    }
    
    public boolean isBackItem() {
        return mIsBackItem;
    }
    
    public String getName() {
        return mName;
    }
    
    public String getUrl() {
        return mUrl;
    }
}
